const Mock = require('mockjs')

const BoutiquepurchaseList=[];
for(let i=0;i<100;i++){
    BoutiquepurchaseList.push(
        Mock.mock({
            id:'@increment',
            number:'@integer(111111,999999)',
            entrytype:'@integer(0,5)',
            entrycost:'@integer(100,50000)',
            boutiquename:'@first',
            paytype:'@integer(111111,999999)',
            entrystate:'@integer(0,5)',
            paystate:'@integer(0,5)',
            guider:'@first',
            state:'@integer(0,1)',
            remark:'',
            createtime:'@datetime'
        })
    )
}

const BoutiquesaleList=[];
for(let i=0;i<100;i++){
    BoutiquesaleList.push(
        Mock.mock({
            id:'@increment',
            number:'@integer(111111,999999)',
            boutiquename:'@first',
            customername:'@first',
            count:'@integer(111111,999999)',
            totalmoney:'@integer(111111,999999)',
            paytype:'@integer(0,5)',
            collectstate:'@integer(0,5)',
            guider:'@first',
            state:'@integer(0,1)',
            remark:'',
            createtime:'@datetime'
        })
    )
}

const BoutiqueExtraList=[];
for(let i=0;i<100;i++){
    BoutiqueExtraList.push(
        Mock.mock({
            id:'@increment',
            number:'@integer(111111,999999)',
            extraparter:'@first',
            extracount:'@integer(1,4)',
            totalmoney:'@integer(100,40000)',
            guider:'@first',
            state:'@integer(0,1)',
            remark:'',
            createtime:'@datetime'
        })
    )
}



module.exports=[
    {
        url: '/api/finance/boutiquepurchase',
        type: 'get',
        response: config => {
          const { name, page = 1, limit = 20, sort } = config.query
    
          let mockList = BoutiquepurchaseList.filter(item => {
            return true
          })

    
          const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))
    
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: pageList
            }
          }
        }
    },
    {
        url: '/api/finance/boutiquesale',
        type: 'get',
        response: config => {
          const { name, page = 1, limit = 20, sort } = config.query
    
          let mockList = BoutiquesaleList.filter(item => {
            return true
          })

    
          const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))
    
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: pageList
            }
          }
        }
    },
    {
        url: '/api/finance/boutiqueextra',
        type: 'get',
        response: config => {
          const { name, page = 1, limit = 20, sort } = config.query
    
          let mockList = BoutiqueExtraList.filter(item => {
            return true
          })

    
          const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))
    
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: pageList
            }
          }
        }
    },
    
]